home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-0497 / AMOSLIST / Textfile.txt < prev    next >
Encoding:
Text File  |  1998-06-24  |  7.8 KB  |  190 lines

  1.   Here we go again. Another month has come  to an end, and soon I can down-
  2. load the March archive and see if anyone ignored what I said about contact-
  3. ing me directly because I'm not  on  the  list.  [And  don't tell me how to
  4. subscribe, I have chosen not to because  downloading and processing all the
  5. induvidual messages is to much hassle. The only problem with what I'm doing
  6. now is that attached files come  out  as  Base64,  whatever THAT is. Anyone
  7. know how to convert those  cryptic  text  chunks  back  into their original
  8. form? (And if it can't be done, what's the point with including them in the
  9. archive in the first place?)
  10.   Talking of archives, here's a little  batch  file I put together for pro-
  11. cessing them.
  12.  
  13. ;Type f.ex. "ual 06 96" to unpack 0696.lhz to 9606
  14.  
  15. lha e <mo><ye>.lzh AMOSLIST
  16. rename AMOSLIST <ye><mo>
  17. ask "Delete <mo><ye>.lzh? "
  18. if warn
  19. delete <mo><ye>.lzh
  20. endif
  21.  
  22. This unpacks just the main file from  the  archive,  renames it and deletes
  23. the archive after asking just to be sure.  Renaming it means I can keep all
  24. the monthlies in the same directory (and  won't have to check the file date
  25. to see which is which either), and  switching  year  and month around means
  26. the files will get listed in  chronological  order  when sorted "alphabeti-
  27. cally" (On Aminet all the January  files  are  grouped together followed by
  28. all the February files and so on.).
  29.   BTW, because I use a PC to download  the  files  and MessyDos to transfer
  30. then to AmigaDOS, I have to shorten the filenames to month/year/suffix as I
  31. download them, and this file is  madeto  handle those shortened file names.
  32. If you download the files  directly  to  your  Amiga  under their  original
  33. names, change all references to "<mo><ye>.lzh" to "Amoslist-<mo><ye>.lzh".
  34.  
  35.   One of the things I found out while going  through last winter's mail was
  36. that one of the questions I  asked  recently  has  been asked twice before.
  37. Hey, does that make it a Frequently  Asked  Question?  At least it has been
  38. asked more frequently than "What is AMOS?",  which is the first question in
  39. the FAQ. (Look Mike, if we didn't  know  what Amos was we wouldn't be here,
  40. right?)
  41.  
  42.   But now it's time for a  Completely  Useless  Program.  Everyone  (with a
  43. manual) knows Amos has  a  command  called  Load  IFF  that  will load most
  44. pictures in a jiffy or two. Here's a  program  that  does the job in half a
  45. minute (wih a lo-res pic).
  46.  
  47. 'Load-ILBM by Mac Larsson 1988 
  48. ' AMOSized by Ragnar Fyri 1997 
  49. DEMOPIC:
  50. A$=Fsel$("") : Rem filename 
  51. B=1 : Rem screen number  
  52. T=Timer
  53. LPICILBM[A$,B]
  54. TD=Timer-T
  55.  Wait Key 
  56. Screen Close B
  57. Print "Operation took";TD;" clicks."
  58. End 
  59. Procedure LPICILBM[FILENAME$,SCRN]
  60.    Open In 1,FILENAME$
  61.    If Input$(1,4)<>"FORM" Then Goto FAIL
  62.    A$=Input$(1,4) : If Input$(1,8)<>"ILBMBMHD" Then Goto FAIL
  63.    A$=Input$(1,4) : CVI[Input$(1,2)] : WINDX=Param
  64.    CVI[Input$(1,2)] : WINDY=Param : A$=Input$(1,4)
  65.    DEEP=Asc(Input$(1,1)) : A$=Input$(1,1)
  66.    COMP=Asc(Input$(1,1)) : A$=Input$(1,5)
  67.    CVI[Input$(1,2)] : MXX=Param : CVI[Input$(1,2)] : MXY=Param
  68.    If Input$(1,4)<>"CMAP" Then Goto FAIL
  69.    CVL[Input$(1,4)] : NUMCOL=Param : RES=0
  70.    If MXX>320 Then Add RES,Hires
  71.    If MXY>256 Then Add RES,Laced
  72.    Screen Open SCRN,MXX,MXY,2^DEEP,RES
  73.    Curs Off : Flash Off : Hide On 
  74.    Dim CMAP(2),PLANE(DEEP-1)
  75.    For A=0 To NUMCOL/3-1
  76.       For B=0 To 2
  77.          CMAP(B)=(Asc(Input$(1,1)) and 240)
  78.       Next 
  79.       Colour A,(CMAP(0)*16)+CMAP(1)+(CMAP(2)/16)
  80.    Next 
  81.    For A=0 To DEEP-1
  82.       PLANE(A)=Leek(Screen Base+A*4)
  83.    Next 
  84.    While BODY<>4
  85.       If Instr("BODY",Input$(1,1)) Then BODY=BODY+1 Else BODY=0
  86.    Wend : A$=Input$(1,4)
  87.    If COMP=0
  88.       For A=1 To WINDY
  89.          For P=0 To DEEP-1
  90.             For B=0 To MXX/8-1 Step 4
  91.                CVL[Input$(1,4)] : Loke PLANE(P)+B,Param
  92.             Next 
  93.             PLANE(P)=PLANE(P)+MXX/8
  94.          Next 
  95.          Gosub BREAK
  96.       Next 
  97.    Else 
  98.       For A=0 To WINDY-1
  99.          For B=0 To DEEP-1
  100.             SCRROW=PLANE(B)+(A*MXX/8) : C=0
  101.             While C<MXX/8
  102.                CODEIN=Asc(Input$(1,1))
  103.                If CODEIN<128
  104.                   SCRDATA$=Input$(1,CODEIN+1)
  105.                   For J=1 To Len(SCRDATA$)
  106.                      Poke SCRROW+C+J-1,Asc(Mid$(SCRDATA$,J,1))
  107.                   Next 
  108.                   C=C+CODEIN+1
  109.                Else 
  110.                   If CODEIN>128
  111.                      INBYTE=Asc(Input$(1,1))
  112.                      For J=C To C+257-CODEIN
  113.                         Poke SCRROW+J,INBYTE
  114.                      Next 
  115.                      C=C+257-CODEIN
  116.                   End If 
  117.                End If 
  118.             Wend 
  119.          Next 
  120.          Gosub BREAK
  121.       Next 
  122.    End If 
  123.    Close 
  124.    Pop Proc
  125.    BREAK:
  126.    A$=Inkey$ : If A$<>"q" Then Return 
  127.    FAIL:
  128.    Cls : Print "Can't load picture!"
  129.    Wait Key 
  130.    Screen Close SCRN
  131.    Edit 
  132. End Proc
  133. '
  134. Procedure CVI[BYTES$]
  135.    NUMBER=Asc(BYTES$)*256
  136.    Add NUMBER,Asc(Right$(BYTES$,1))
  137. End Proc[NUMBER]
  138. '
  139. Procedure CVL[BYTES$]
  140.    CVIove" action="http://207.82.250.251/cgi-bin/nextprev">
  141. <input type="hidden" name="disk" value="207.82.250.104_d0">
  142. <input type="hidden" name="login" value="ragnar_fyri">
  143. <input type="hidden" name="f" value="1025">
  144. <input type="hidden" name="curmbox" value="ACTIVE">
  145. <input type="hidden" name="msg" value="MSG09712192">
  146. <input type="hidden" name="js" value="">
  147. <table border=0 cellpadding=0 cellspacing=0 width=498>
  148. <tr>
  149. <td width=76><input type=image name="Move To"
  150. src="http://207.82.250.8/do_move.gif" [Left$(BYTES$,2)] : NUMBER=Param*256^2
  151.    CVI[Right$(BYTES$,2)] : Add NUMBER,Param
  152. End Proc[NUMBER]
  153.  
  154.   Those who have been around for a while  may remember that AmigaBasic came
  155. with a couple of demo programs that  showed  how  to load and save pictures
  156. using library routines. A bit later  one  Mac  Larsson (see comment line 1)
  157. showed how it could be done entirely in Basic without libraries. I typed in
  158. the programs and  experimented  a  bit  with  them,  then  I filed the disk
  159. somewhere and forgot  about  it.  Recently  I  came  across  the disk while
  160. looking for someone else and decided to try to convert the programs to Amos
  161. just for fun and to see how fast it would  be. AmigaBasic has two functions
  162. called CVI and CVL (ConVert Integer and ConVert Long) that I had to emulate
  163. with procedures. [I tried using Def Fn, but that didn't work!]
  164.   As I said, it takes half a minute to  do  a plain 320*200*16 picture, and
  165. compiling only halves that,  so  what's  the  point?  Well, you can see the
  166. picture loading and learn a bit  about  how it's stored (and figure out why
  167. it's called InterLeaved BitMap), and figuring out how it works may help you
  168. understand the file format if you have  need for that. (Someone asked about
  169. that once, I think.)
  170.   Mac also wrote a  couple  of  programs  for  saving  ILBM  files, and for
  171. laoding and saving  ACBM  (Amiga  Continous  BitMap),  but  I haven't tried
  172. converting them yet. One problem  with  LoadACBM is that it seems to load a
  173. whole bitplane at a time into one st  Hi. Just checked  out  Elevators  after 
  174. I  noticed  the  title in an old
  175. Amoslist archive. (That's right, it  was  the  name that first attracted my
  176. attention...) It's a nice  twist  on  an  old  theme  with some pretty good
  177. graphics, but there are some details I can't say I like.
  178.   It's been ages since I saw a S&L board,  but as far as I remember, snakes
  179. would always take you at least  one  level  down  and  ladders at least one
  180. level up. In your game you move  the  counters  sideways  and call itring, and
  181. Amos it looks like Amos can't
  182. handle that, so it needs a major rewrite.  BTW, it may be possible to write
  183. faster versions of all the programs simply  by loading files into banks and
  184. moving data around with *eek and  Copy.  Probably is - it's all that string
  185. handling that slows things down...
  186.  
  187.   Talking of things Amos can't handle, I have this big file I tried reading
  188. as a random file, but the program crashed  when trying to read record 32769
  189. - that is 32K+1. Can't Amos  handle
  190.